//
//  LBIMManager.h
//  app
//
//  Created by 刘文扬 on 16/8/22.
//  Copyright © 2016年 广东联结电子商务有限公司. All rights reserved.
//


#import "LBIMUserInfo.h"
#import "LBIMHistoryMessageListModel.h"


typedef void(^ LBRCRequestSuccessDataBlock) (NSDictionary *data);
typedef void(^ LBRCRequestSuccessBoolBlock) (BOOL success);
typedef void(^ LBRCRequestFailBlock) (NSString *message);


@interface LBIMManager : NSObject


+(void)getUserInfoWithIMUserId:(NSString *)imUserId success:(void (^)(LBIMUserInfo *userInfo))success fail:(void (^)(NSString *message))fail;
/*
 @  content :	消息内容	 模糊查询
 @  conversationType :	会话类型	 二人会话是 1 、讨论组会话是 2 、群组会话是 3 、聊天室会话是 4 、客服会话是 5 、 系统通知是 6 、应用公众服务是 7 、公众服务是 8
 @  pageIndex :	页数
 @  pageSize : 每页条数
 @  toUserId :接受人ID	 	会话类型为3是传入群组ID
 */
+(void)getIMHistoryMessageByContent:(NSString *)content
                   conversationType:(NSInteger)conversationType
                          pageIndex:(NSInteger)pageIndex
                           pageSize:(NSInteger)pageSize
                           toUserId:(NSString *)toUserId
                            success:(LBRCRequestSuccessDataBlock)success
                               fail:(LBRCRequestFailBlock)fail;

+(void)getIMIdWithUserId:(NSString *)userId
                 success:(LBRCRequestSuccessDataBlock)success
                    fail:(LBRCRequestFailBlock)fail;

/*
 @  content :	消息内容	 模糊查询
 @  pageIndex :	页数
 @  toUserId :接受人ID	 	会话类型为3是传入群组ID
 */
+(void)getBidTenderIMHistoryMessageByContent:(NSString *)content
                                   pageIndex:(NSInteger)pageIndex
                                    toUserId:(NSString *)toUserId
                                     success:(LBRCRequestSuccessDataBlock)success
                                        fail:(LBRCRequestFailBlock)fail;


#pragma mark - 融云IM
/**
 *  获取融云IM Token
 *
 *  @param success 成功回调
 *  @param fail    失败回调
 */
+ (void)getIMTokenWithSuccess:(void(^)(NSString *token))success fail:(void(^)(NSString *message))fail;
/**
 获取融云IM我们服务器本地的Token
 
 @param success success description
 @param fail    fail description
 */
+ (void)getIMLocalTokenWithSuccess:(void(^)(NSString *token))success fail:(void(^)(NSString *message))fail;

@end
